import request from '@/utils/request'

export function roleAdd (url, obj) {
  // 编辑和新增
  return request({
    url: '/role/' + url,
    method: 'post',
    data: obj
  })
}

export function roleSearch (pageSize, pageNo) {
  return request({
    url: '/role/findAll',
    method: 'post',
    data: {
      // pageSize,
      // pageNo
    }
  })
}

export function roleSearchPage (pageSize, pageNo) {
  return request({
    // url: '/role/selectURole',
    url: '/role/findAll',
    method: 'post',
    data: {
      // pageSize,
      // pageNo
    }
  })
}

export function treeQuery () {
  return request({
    // url: '/permissionOne/findAllPermission',
    url: '/permission/findAllPermission',
    method: 'post',
    data: {}
  })
}

export function accrQuery (id) {
  return request({
    url: '/urolepermission/queryByRole/' + id, /// urolepermission/queryByRole
    method: 'get'
  })
}

export function accrSave (obj) {
  return request({
    url: '/urolepermission/addrelated',
    method: 'post',
    data: obj
  })
}

export function roleDel (obj) {
  return request({
    url: '/role/dels',
    method: 'post',
    data: obj
  })
}
